package com.blb.service.impl;


import com.blb.dao.UserDao;
import com.blb.dao.impl.UserDaoImpl;
import com.blb.pojo.User;
import com.blb.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.sql.SQLException;

@Service
public class UserServiceImpl implements IUserService {
    @Autowired
    UserDao userDao;

    @Override
    public User getByUsername(String username) throws Exception {
        return userDao.getByUsername(username);
    }

    @Override
    public List<User> list() throws Exception {
        List<User> list = userDao.list();
        return list;
    }

    @Override
    public void add(User user) throws SQLException {
        userDao.add(user);
    }
}
